package Cola;

/**
 * @Author Zhang Chao
 * @Date 2021/5/19 21:02
 * @Version 1.0
 * SalesEmployee ：ColaEmployee 的子类，销售人员，工资由月销售额和提成率决定。属性：月销售额、提成率
 */
public class SalesEmployee extends ColaEmployee{

//    private int monthlySalesVolume;
//    private int royaltyRate;

    private int monthSales;//月销售额
    private double royaltyRate;//提成率

    public SalesEmployee(String name, int month,int monthSales,double royaltyRate) {
        super(name, month);
        this.monthSales = monthSales;
        this.royaltyRate = royaltyRate;
    }
    //	工资=月销售额*提成率
    @Override
    public double getSalary(int month) {
        if(super.month == month) {
            return monthSales * royaltyRate + 100;
        }else {
            return monthSales * royaltyRate;
        }
    }

}
